from multiprocessing import Process
import time


def task(name):
    print('%s总管正在活着' % name)
    time.sleep(3)
    print('%s总管正在死亡' % name)


if __name__ == '__main__':
    p = Process(target=task, args=('egon', ))
    # p = Process(target=task, kwargs={'name':'egon'})
    p.daemon = True  # 将p设置成守护进程 必须放在start方法上面
    p.start()
    print('皇帝json正在正寝')